import Mock,{Random} from "mockjs"

Mock.mock("/user", 'post',function(option){
    console.log('mock request data:'+JSON.stringify(option));

    return Mock.mock({
        "status":Random.status(),
        "data":Random.guid(),
    });
})


// 


Mock.mock("/user/menus", 'get',function(option){
    console.log('mock request data:'+JSON.stringify(option));

    return Mock.mock({
        "status":2,
        "data|1-4":[{
            id:Random.guid(),
            name:Random.cword(3,5),
            path:Random.path(),
            "childNode|1-5":[
                {
                    id:Random.guid(),
                    name:Random.cword(3,5),
                    path:Random.path(),
                }
            ]
        }]
    });
})


Mock.mock("/user/info", 'get',function(option){
    console.log('mock request data:'+JSON.stringify(option));

    return Mock.mock({
        "status":2,
        "data":{
           "userEmail":Random.email(),
           "userName":Random.cname(),
           "image":Random.image(),
           "items|4":[{
               rightId:Random.guid(),
               rightName:Random.cword(5),
               rightType:Random.integer(1,3),
               createDate:Random.datetime('yyyy-MM-dd HH:mm:ss'),
               updateDate:Random.datetime('yyyy-MM-dd HH:mm:ss'),
               "rights|0-2":[
                   {
                    rightId:Random.guid(),
                    rightName:Random.cword(5),
                    rightType:Random.integer(1,1),
                    createDate:Random.datetime('yyyy-MM-dd HH:mm:ss'),
                    updateDate:Random.datetime('yyyy-MM-dd HH:mm:ss'),
                   }
               ]
           }
           ]
        }
    });
})
